package com.loeng.module.system.service.logger;

import com.loeng.framework.common.util.object.BeanUtils;
import com.loeng.module.system.api.logger.dto.OperateLogCreateReqDTO;
import com.loeng.module.system.dal.dataobject.logger.OperateLogDO;
import com.loeng.module.system.dal.mysql.logger.OperateLogMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OperateLogServiceImpl implements OperateLogService {

    @Resource
    private OperateLogMapper operateLogMapper;

    /**
     * 记录操作日志
     *
     * @param createReqDTO 创建请求
     */
    @Override
    public void createOperateLog(OperateLogCreateReqDTO createReqDTO) {
        OperateLogDO log = BeanUtils.toBean(createReqDTO, OperateLogDO.class);
        operateLogMapper.insert(log);
    }

}
